#!/bin/sh

startYear=1994
endYear=2007

ticker=$1

if [ -z $ticker ]
then
	echo "please input the ticker"
	read ticker
fi

cd top50
echo "$ticker" > all.top50
awk -f to_array.awk all.top50 > all.array.top50

while [ $startYear -le $endYear ]
do
	cat all.array.top50 > ${startYear}.array.top50
	startYear=$((startYear+1))
done

mv *.top50 ../

cd ..

#pwd
#./SMW.sh

#pwd
#./convert_SMW_to_return.sh


#pwd
#./caculate_return.sh
